#include<iostream>
#include<string>
#include<cstdio>
using namespace std;
int n,k;
string s;
int vis[505];
int cnt;
int anss;
bool chk(int l,int r){
	int kk=0;
	int ll=l,rr=r;
	if(ll==rr-1) return true;
	bool b=1;
	for(int i=ll+1;i<=rr-1;i++){
		if(s[i]=='*'){
			
		}else{
			b=0;
			break;
		}
	}
	if(b==1){
		if(rr-ll-1<=k){
			return true;
		}else{
			//cout<<'d';
			return false;
		}
	}
	while(1){
		ll++;
		if(s[ll]=='*'){
			kk=1;
		}else if(s[ll]=='('){
			break;
		}
		else{
			//cout<<'c';
			return false;
		}
	}
	while(1){
		rr--;
		if(s[rr]=='*'){
			if(kk==1){
				//cout<<l<<r;
				return false;
			}
		}else if(s[rr]==')'){
			break;
		}
		else{
			return false;
			//cout<<'a';
		}
	}
	return chk(ll,rr);
}
void dfs(int x,int ans){
	//cout<<endl<<s<<endl;
	if(x>=n){
		//cout<<endl<<s<<endl;
		//cout<<1;
		return;
		
	} 
	if(ans>k){
		//cout<<endl<<s<<endl;
		//cout<<2;
		return;
	}
	if(s[x]=='('){
		anss++;
		dfs(x+1,0);
		anss--;
	}else if(s[x]=='*'){
		
		dfs(x+1,ans+1);
	}else if(s[x]==')'){
		
		bool b=1;
		for(int i=x-1;i>=0;i--){
			if(s[i]=='('&&!vis[i]){
				if(chk(i,x)){
					anss--;
					b=0;
					if(x==n-1&&anss==0){
						cnt++;
						//cout<<"rp++";
					}
					vis[i]=1;
					vis[x]=1;
					
					dfs(x+1,0);
					anss++;
					vis[i]=0;
					vis[x]=0;
					return;
				}
				
			}
		}
		//cout<<endl<<s<<endl;
		
	}else{
		//cout<<endl<<x<<endl;
		s[x]='*';
		dfs(x,ans);
		s[x]='(';
		dfs(x,ans);
		s[x]=')';
		dfs(x,ans);
		s[x]='?';
	}
}
int main(){
	freopen("bracket.in","r",stdin);
	freopen("bracket.out","w",stdout);
	cin>>n>>k>>s;
	dfs(0,0);
	cout<<cnt;
	return 0;
}
